package com.gagakuai.exception;

import com.gagakuai.enumeration.BusinessCodeEnum;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/*
 * 业务异常
 * @author JianBai
 * @date 2022/10/22 22:21
 */
@Getter
public class BizException extends RuntimeException {



    private BusinessCodeEnum codeEnum;

    private Integer status = 400;

    public BizException(String msg) {
        super(msg);
    }

    public BizException(HttpStatus status, String msg) {
        super(msg);
        this.status = status.value();
    }

    public BizException(int code, String msg) {
        super(msg);
        this.status = code;
    }


    public BizException(BusinessCodeEnum businessCodeEnum) {

        this.codeEnum = businessCodeEnum;
    }
}

